local nengxue = fk.CreateSkill {
  name = "cf_nengxue",
  tags = { Skill.Compulsory, }
}

Fk:loadTranslationTable {
  ["cf_nengxue"] = "冷血",
  [":cf_nengxue"] = "锁定技，1.你每回合前两次造成的伤害改为冰属性伤害且伤害加一；2.当有伤害被防止时，你摸两张牌并回复一点体力。",
  ["$cf_nengxue1"] = "冻结吧！",
  ["$cf_nengxue2"] = "这个如何。",
}

nengxue:addEffect(fk.PreDamage, {
  anim_type = "offensive",
  can_trigger = function(self, event, target, player, data)
    return player:hasSkill(nengxue.name) and data.from == player and data.damageType ~= fk.IceDamage and
        player:getMark(nengxue.name .. "-phase") <= 1
  end,
  on_cost = Util.TrueFunc,
  on_use = function(self, event, target, player, data)
    data.damageType = fk.IceDamage
    data:changeDamage(1)
    player:addMark(nengxue.name .. "-phase", 1)
  end
})

nengxue:addEffect(fk.DamageFinished, {
  anim_type = "drawcard",
  can_trigger = function(self, event, target, player, data)
    return player:hasSkill(nengxue.name) and data.prevented
  end,
  on_cost = Util.TrueFunc,
  on_use = function(self, event, target, player, data)
    local room = player.room
    player:drawCards(2, nengxue.name)
    room:recover {
      who = player,
      num = 1,
      skillName = nengxue.name,
      recoverBy = player,
    }
  end
})

return nengxue
